package com.sumainfor.wx.tenant.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.common.utlis.Pager;
import com.sumainfor.wx.tenant.feign.CfoFeignClient;
import com.sumainfor.wx.tenant.feign.OperationsFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

/**
 * @author Meng
 * @ClassName InvoiceController
 * @date 2019/4/28 11:05
 * @description: TODO 开票功能控制层
 */

@RestController
@RequestMapping("/invoice")
public class InvoiceController {

    @Autowired
    OperationsFeignClient OperationsFeignClient;

    @Autowired
    CfoFeignClient CfoFeignClient;

    /**
     * @Description //TODO 查询用户已支付的账单列表, 返回的列表里有已经开具发票的列表和未开具发票的列表
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/4/28 16:34
     **/
    @GetMapping("/listTenantBillHavePaid")
    public JsonResult listTenantBillHavePaid(@RequestParam Map<String,Object> params, Pager pager) {
        params.put("pageno",pager.getPageno());
        params.put("pagesize",pager.getPagesize());
        JsonResult result=OperationsFeignClient.listTenantBillHavePaid(params);
        return result;
    }

    /**
     * 功能描述: 
     * 租客申请发票信息
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/5/6 10:09
     */
    @PostMapping("/insertInvoice")
    public JsonResult insertInvoice(@RequestBody Map<String,Object>params){
        return CfoFeignClient.insertInvoice(params);
    }


}
